import axios from "axios";
import {
  BASE_URL_lcx,
  BASE_URL_lb,
  BASE_URL_yxx,
  BASE_URL_hxm,
  TIMEOUT,
} from "./config";

const request_lcx = axios.create({
  baseURL: BASE_URL_lcx,
  timeout: TIMEOUT,
});

const request_lb = axios.create({
  baseURL: BASE_URL_lb,
  timeout: TIMEOUT,
});

const request_yxx = axios.create({
  baseURL: BASE_URL_yxx,
  timeout: TIMEOUT,
});

const request_hxm = axios.create({
  baseURL: BASE_URL_hxm,
  timeout: TIMEOUT,
});

//请求拦截
// request.interceptors.request.use(config=>{
//   //某一些请求要求用户必须携带token,如果没有携带直接跳转都登录页面

//   //params/data 序列化的操作
//   // console.log("请求被拦截");
//   return config

// },err=>{
//   if(err&&err.response){
//     // console.log("请求错误");
//   }
// })

// export default request;

export { request_lcx, request_lb, request_yxx, request_hxm };
